<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/common/include/taglibs.jsp"%>
<%@ page language="java" import="java.util.*,
								 com.kylin.hibernate.*,
								 com.kylin.common.util.*,
                                 org.hibernate.*,
                                 com.kylin.module.shop.orm.*,
                                 org.apache.struts.util.LabelValueBean" %>

<%
	org.hibernate.Session hsession= BaseHibernateDAO.getSession(); 
	String strSQL="from Company as com where com.user.country= :pcountry and com.name like :pname";   
    Query query = hsession.createQuery(strSQL);   
    query.setString("pname", "%%");  
    query.setString("pcountry","zh_CN") ;
    List rs=query.list();   
	for(int i=0;i<rs.size();i++){
	Company com = (Company)rs.get(i);
	    out.println("<br> com="+ com.getName());
	    out.print(" '  "+ com.getUser().getCountry() + " ' ");
	    Set catp = com.getMaincatproduct();
	    CompanyCat[] cats = (CompanyCat[])catp.toArray(new CompanyCat[0]);
	    for(int j=0;j<cats.length;j++){
	       out.print(" ["+cats[j].getCatproduct() + "] ");
	    }
	}

%>
